my file learn about tech container (docker, podman, kubernetes)
apiVersion: v1
kind: ReplicationController
metadata:
name: nama-replication-controller
labels:
label-key1: label-value1
annotations:
annotation-key1: annotation-value1
spec:
replicas: 3
selector:
label-key1: label-value1
template:
metadata:
name: nama-pod
labels:
label-key1: label-value1
spec:
containers:
- name: container-name
image: image-name
ports:
- containerPort: 80
readinessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 0
periodSeconds: 10
failureThreshold: 3
successThreshold: 1
timeoutSeconds: 1
apiVersion: v1
kind: ReplicationController
metadata:
name: nginx-rc
spec:
replicas: 3
selector:
app: nginx
template:
metadata:
name: nginx
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
kubectl get rc
NAME READY STATUS RESTARTS AGE
nginx-rc-bvg5g 1/1 Running 0 108s
nginx-rc-dklh5 1/1 Running 0 108s
nginx-rc-swrsg 1/1 Running 0 108s
# ketika dihapus maka secara otomatis akan di replica sampai menjadi 3 pod lagi
kubectl delete pod
kubectl get pod
nginx-rc-cxlsq 1/1 Running 0 22s
nginx-rc-dklh5 1/1 Running 0 3m25s
nginx-rc-swrsg 1/1 Running 0 3m25s
kubectl delete rc <namerc>
kubectl delete rc <namerc> --cascade=false